#include "filter.h"

Filter::Filter(int size)
{
    setSize(size);
}

void Filter::setSize(int size)
{
    if (size % 2 == 0) {
        qWarning("Filter::setSize: The size of a kernel can not be an even number.");
        m = -1;
        return;
    }
    m = size;
    doSetSize(size);
}

QImage Filter::filtered(const QImage &image)
{
    wasCanceled = false;
    return doFiltering(image);
}

void Filter::cancel()
{
    wasCanceled = true;
}
